<template>
  <div class="order">
    <Header title="订单"></Header>
    <div class="content">
      <van-tabs color="#ffc400">
        <van-tab v-for="(item, index) in tabData" :key="index" :title="item">
          <div
            v-for="(i, index) in store.state.orderListEnd"
            :key="index"
            v-if="item === '全部' && store.state.orderListEnd.length"
          >
            <van-card
              :num="i.num"
              :price="i.price"
              :title="i.title"
              :thumb="i.pic"
            />
          </div>
          <div v-else>
            <Empty></Empty>
          </div>
        </van-tab>
      </van-tabs>
    </div>
    <Footer></Footer>
  </div>
</template>

<script setup>
import Header from "@/components/Header.vue";
import Empty from "@/components/Empty.vue";
import { ref } from "vue";
import { useStore } from "vuex";
let tabData = ref(["全部", "交易完成", "待付款", "待发货", "已发货"]);
const store = useStore();
</script>

<style lang="less" scoped>
.order {
  display: flex;
  flex-direction: column;
  height: 100%;
  .content {
    flex: 1;
    overflow-y: auto;
  }
}
</style>
